/**
 * Copyright
 */
package org.sevaapp.domain;

import javax.persistence.CascadeType;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.MappedSuperclass;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToOne;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import org.springframework.beans.factory.annotation.Autowired;

import org.sevaapp.dao.LabDao;
import org.sevaapp.dao.DaoException;

/**
 *  THIS IS A CODE GENERATED FILE. DO NOT EDIT.
 */

@MappedSuperclass
public abstract class BaseLab extends BaseDomainObject {

	private static final Log log = LogFactory.getLog(BaseLab.class);

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	private Integer id;

	public void setId(Integer id) {
		this.id = id;
	}

	public Integer getId() {
		return id;
	}

	private String labName;

	public void setLabName(String labName) {
		this.labName = labName;
	}

	public String getLabName() {
		return labName;
	}

//	@OneToOne(fetch = FetchType.EAGER, cascade = {CascadeType.PERSIST, CascadeType.REMOVE})
//	@JoinColumn(name = "ID", nullable = false)
//	private Address labAddress;
//
//	public void setLabAddress(Address labAddress) {
//		this.labAddress = labAddress;
//	}
//
//	public Address getLabAddress() {
//		return labAddress;
//	}

	private String address1;
	public String getAddress1() {
		return address1;
	}

	public void setAddress1(String address1) {
		this.address1 = address1;
	}

	private String address2;
	public String getAddress2() {
		return address2;
	}

	public void setAddress2(String address2) {
		this.address2 = address2;
	}
	
	private String city;
	public String getCity() {
		return city;
	}

	public void setCity(String city) {
		this.city = city;
	}

	private String state;
	public String getState() {
		return state;
	}

	public void setState(String state) {
		this.state = state;
	}
	
	private int		zip;
	public int getZip() {
		return zip;
	}

	public void setZip(int zip) {
		this.zip = zip;
	}
	
	private int remainingResources;
	
	public int getRemainingResources() {
		return remainingResources;
	}

	public void setRemainingResources(int remainingResources) {
		this.remainingResources = remainingResources;
	}

	private String faxNumber;

	public void setFaxNumber(String faxNumber) {
		this.faxNumber = faxNumber;
	}

	public String getFaxNumber() {
		return faxNumber;
	}

	private String authorizingMgrName;

	public void setAuthorizingMgrName(String authorizingMgrName) {
		this.authorizingMgrName = authorizingMgrName;
	}

	public String getAuthorizingMgrName() {
		return authorizingMgrName;
	}

	private String authMgrPhone;

	public void setAuthMgrPhone(String authMgrPhone) {
		this.authMgrPhone = authMgrPhone;
	}

	public String getAuthMgrPhone() {
		return authMgrPhone;
	}

	private String authMgrEmail;

	public void setAuthMgrEmail(String authMgrEmail) {
		this.authMgrEmail = authMgrEmail;
	}

	public String getAuthMgrEmail() {
		return authMgrEmail;
	}

	private String altAuthorizingMgrName;

	public void setAltAuthorizingMgrName(String altAuthorizingMgrName) {
		this.altAuthorizingMgrName = altAuthorizingMgrName;
	}

	public String getAltAuthorizingMgrName() {
		return altAuthorizingMgrName;
	}

	private String altAuthMgrPhone;

	public void setAltAuthMgrPhone(String altAuthMgrPhone) {
		this.altAuthMgrPhone = altAuthMgrPhone;
	}

	public String getAltAuthMgrPhone() {
		return altAuthMgrPhone;
	}

	private String altAuthMgrEmail;

	public void setAltAuthMgrEmail(String altAuthMgrEmail) {
		this.altAuthMgrEmail = altAuthMgrEmail;
	}

	public String getAltAuthMgrEmail() {
		return altAuthMgrEmail;
	}

	private Integer monthlyCommitment;

	public void setMonthlyCommitment(Integer monthlyCommitment) {
		this.monthlyCommitment = monthlyCommitment;
	}

	public Integer getMonthlyCommitment() {
		return monthlyCommitment;
	}

	private Integer gratisTest;

	public void setGratisTest(Integer gratisTest) {
		this.gratisTest = gratisTest;
	}

	public Integer getGratisTest() {
		return gratisTest;
	}

	private java.util.ArrayList<String> servicesProvided;

	public void setServicesProvided(java.util.ArrayList<String> servicesProvided) {
		this.servicesProvided = servicesProvided;
	}

	public java.util.ArrayList<String> getServicesProvided() {
		return servicesProvided;
	}

	private double discountPct;

	public void setDiscountPct(double discountPct) {
		this.discountPct = discountPct;
	}

	public double getDiscountPct() {
		return discountPct;
	}

	private double flatFeePerTest;

	public void setFlatFeePerTest(double flatFeePerTest) {
		this.flatFeePerTest = flatFeePerTest;
	}

	public double getFlatFeePerTest() {
		return flatFeePerTest;
	}

	@Autowired
	@Transient
	private LabDao dao;

	// CRUD Methods
	public void add(Lab labData) {
		log.debug("add(domainData) method called.");
		try {
			dao.add(labData);
		} catch (DaoException ex) {
			ex.printStackTrace();
		}
	}

	public void add() {
		log.debug("add() method called.");
		try {
			dao.add((Lab) this);
		} catch (DaoException ex) {
			ex.printStackTrace();
		}
	}

	public void delete(Integer id) {
		log.debug("delete() method called.");
		try {
			dao.delete(id);
		} catch (DaoException ex) {
			ex.printStackTrace();
		}
	}

	public void update(Lab domainObject) {
		log.debug("update() method called.");
		try {
			dao.update(domainObject);
		} catch (DaoException ex) {
			ex.printStackTrace();
		}
	}

	public Lab load(Integer id) {
		log.debug("load() method called.");
		Lab newDomainObj = null;
		try {
			newDomainObj = dao.load(id);
		} catch (DaoException ex) {
			ex.printStackTrace();
		}
		return newDomainObj;
	}

}
